import instance from './index';
import { Project } from '../model/project';

/**
 * 
 * @param params 项目列表
 * @returns 
 */
export function fetchProjectList(params: any = {}): Promise<any> {
    return instance.get('/project', {
        params: params
    });
}

export function createProject(data: Project): Promise<any> {
    return instance.post(`/project`, data);
}

/**
 * 删除项目
 * @param params 
 * @returns 
 */
export function deleteProject(params: Project): Promise<any> {
    return instance.delete(`/project?id=${params.id}`);
}